With the advent of multimedia, digital video and digital audio applications for computers, the need to move vast amounts of digital data very quickly has become increasingly important. For example, in digital video applications, the input from a video source is digitized, and then sent to a computer for digital processing. If the processing is to occur in real-time, the digital video data must be transferred to the computer at a rate no lesser than that at which it is coming in from the video source. Otherwise, some of the video data will be lost and the subsequent processed digital video will appear jumpy to viewers.
The ability of any particular system to move digital data very quickly is exacerbated by the mismatch in bus sizes typically encountered between a multimedia, digital video or digital audio device and a computer. For example, a common specification for digital video calls for a fifty-bit bus, while a PCI bus found on many advanced computers is thirty-two bits in width. The digital data thus must be able to be moved from a fifty-bit bus to a thirty-two-bit bus, and vice-versa, which is difficult in light of the fact that neither bus has a bit width that is a multiple of the width of the other bus.
Another problem is that the format of the input data may be in a different format than is required by the output data. Digital data representing a pixel is typically broken into the constituent color components of that pixel, such as Y, U, V, and A (alpha), or R, G, B, and A (alpha). Each of these components for a particular data format typically has the same number of bits, although other formats specify that the A (alpha) component have less bits than the other components. For example, in one common input data format, each of the components has thirteen bits, or fifty-two bits per pixel (thirteen bits each for of the Y, U, V, and A (alpha) components), while in one particular output data format, each of the components has sixteen bits, or sixty-four bits per pixel. In such instances, the packer must therefore include, or "stuff," extra bits into the output pixels, either at the most significant or least significant end of each pixel's color components. In another common input data format, each of the Y, U, and V components has thirteen bits, while the A (alpha) component has eleven bits.
Furthermore, there is no guarantee that the data on the incoming bus will always be in a particular format, nor that the data on the outgoing bus should always be formatted in accordance with another particular format. That is, the packer may have to contend with many different "packing modes." A packing mode refers to a set of a particular input data format together with a particular output data format. For example, the packing mode described above has an input data format in which each pixel has fifty-two bits (or fifty bits, if the A component only has eleven bits) and an output data format in which each pixel has sixty-four bits. Another packing mode frequently encountered is an input data format in which each pixel has forty bits (ten bits per color component) and an output data format in which each pixel also has forty bits.
Finally, the data on the input bus (i.e., the fifty-bit bus) frequently must be dithered, or otherwise a moire pattern may result when viewing the subsequent processed digital video. Dithering introduces a random element into the digitized video data, so that the patterns that typically cause a moire pattern are broken up sufficiently to prevent the phenomenon from occurring. While dithering may be accomplished at any step during the processing of digital video data, it is convenient and desirable to do so during the packing of data from one bus to another.
Therefore, there is a need for a packer that is programmable in that it is able to pack data on a first bus in any one particular format to a second bus in any other particular format, where the first bus has more bits than the second bus. In other words, the packer should be able to support a plurality of different packing modes. There is a further need for an unpacker that is also programmable, and that can unpack packed data from the second bus to the first bus, also in accordance with a variety of different packing modes. Finally, there is a need for a packer that also dithers data as it packs the data from one bus to another.